﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Threading.Tasks;

using Windows.UI.Xaml.Media;

using Coder.ViewModel;

namespace Coder.Framework
{
    public class Challenge : Bindable
    {
        /// <summary>
        /// Instantiates everything to default values.
        /// </summary>
        public Challenge() { Title = ""; Description = ""; SampleInput = ""; SampleOutput = ""; TestInput = ""; TestOutput = ""; Rating = 0; PointValue = 0; Completed = false; ColSpan = 1; RowSpan = 1; }

        public string Title { get; set; }
        public string Description { get; set; }
        public string SampleInput { get; set; }
        public string SampleOutput { get; set; }
        public string TestInput { get; set; }
        public string TestOutput { get; set; }
        public int Rating { get; set; }
        public int PointValue { get; set; }
        public bool Completed { get { return _complete; } set { _complete = value; PropertyChangedEvent("Completed"); } }


        //User Interface Properties
        public int ColSpan { get { return _colSpan; } set { _colSpan = value; PropertyChangedEvent("TemplateHeight"); } }
        public int RowSpan { get { return _rowSpan; } set { _rowSpan = value; PropertyChangedEvent("TemplateWidth"); } }

        public int TemplateWidth { get { return _templateWidth; } set { _templateWidth = value; PropertyChangedEvent("TemplateWidth"); } }
        public int TemplateHeight { get { return _templateHeight; } set { _templateHeight = value; PropertyChangedEvent("TemplateHeight"); } }

        [XmlIgnore()]
        public SolidColorBrush Color { get { return _color; } set { _color = value; PropertyChangedEvent("Color"); } }

        #region Databinded Local Variables
        private bool _complete;
        private int _colSpan;
        private int _rowSpan;
        private int _templateWidth;
        private int _templateHeight;
        [XmlIgnore()]
        private SolidColorBrush _color;
        #endregion
    }
}
